package uy.edu.um.ltic.client.gui;

import javax.swing.JPanel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;

import uy.edu.um.ltic.client.communication.MessageRemoteClientMgr;
import uy.edu.um.ltic.commons.ExceptionComm;
import uy.edu.um.ltic.exception.DataBaseException;

public class DescargasRenderPanel extends JPanel {

	/**
	 * Create the panel.
	 */
	public DescargasRenderPanel(Integer fileID) {
		
		JLabel lblNewLabel = null;
		try {
			lblNewLabel = new JLabel( MessageRemoteClientMgr.getInstance().getNameOfFile(fileID));
		} catch (ExceptionComm | DataBaseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addComponent(lblNewLabel)
					.addContainerGap(394, Short.MAX_VALUE))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addComponent(lblNewLabel)
					.addContainerGap(20, Short.MAX_VALUE))
		);
		setLayout(groupLayout);

	}
}
